/**
 * Created by Administrator on 2017/5/25.
 */
"use strict";
//引入模块
const mongoose = require('mongoose');
const db = require('./db');

// Schema 结构
var AutoplaySchema = new mongoose.Schema({
    apid      :{type:Number,index: true},//apid
    imgurl    :{type : String},//轮播图路径
    bookHref  :{type : String}
});

AutoplaySchema.statics.findFn = function(obj,obj1, callback) {
    return this.model('Autoplay').find(obj, callback).sort(obj1);
};
AutoplaySchema.statics.findSortOne = function(obj,obj1,callback) {
    return this.model('Autoplay').findOne(obj).sort(obj1).exec(callback);
};

var AutoplayModel = db.model('Autoplay', AutoplaySchema);

module.exports=AutoplayModel;